video: Pause on unset too
authorMatthias Clasen <mclasen@redhat.com>
Sat, 2 Jan 2021 05:06:41 +0000 (00:06 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 2 Jan 2021 06:33:48 +0000 (01:33 -0500)
When new media stream is set on the GtkVideo
widget and we're autoplaying, pause the old one.

Otherwise, the music keeps playing unexpectedly.

gtk/gtkvideo.c

index 7eee5fd5ba6305377f6b264ac5217ce400d29932..8258e251455c14c37f065e4f7df5e35e066b461b 100644 (file)
@@ -593,6 +593,8 @@ gtk_video_set_media_stream (GtkVideo       *self,
 
   if (self->media_stream)
     {
+      if (self->autoplay)
+        gtk_media_stream_pause (self->media_stream);
       g_signal_handlers_disconnect_by_func (self->media_stream,
                                             gtk_video_notify_cb,
                                             self);